import os
import configparser
import sys
#当前文件所在目录
base_path = os.getcwd()

#用例目录
test_case_path  = '../cases/'
runFile = 'cases.py'

#报告路径
report_path = '../report/'



#发送邮件配置
test_config_file = os.path.join(base_path, './config', 'config.ini')
print("打印base_path",base_path,test_config_file)
rc = configparser.ConfigParser()
rc.read(test_config_file, encoding='utf-8')
host = rc.get('email', 'host')
port = rc.get('email', 'port')
sender = rc.get('email', 'sender')
password = rc.get('email', 'password')
receiver = rc.get('email', 'receiver')

#配置mysql数据库
host_mysql = rc.get('mysqldb', 'host')
user_mysql = rc.get('mysqldb', 'user')
password_mysql = rc.get('mysqldb', 'password')
database_mysql = rc.get('mysqldb', 'database')

##配置oracle数据库
name_oracle = rc.get('oracledb', 'name')
password_oracle = rc.get('oracledb', 'password')
ip_oracle = rc.get('oracledb', 'ip')
port_oracle = rc.get('oracledb', 'port')
serverName_oracle = rc.get('oracledb', 'serverName')

##配置sqlserver数据库
name_sqlserver = rc.get('sqlserverdb', 'name')
password_sqlserver = rc.get('sqlserverdb', 'password')
ip_sqlserver = rc.get('sqlserverdb', 'ip')
port_sqlserver = rc.get('sqlserverdb', 'port')
database_sqlserver = rc.get('sqlserverdb', 'database')

##配置达梦数据库
user_dm = rc.get('达梦', 'user')
password_dm = rc.get('达梦', 'password')
server_dm = rc.get('达梦', 'server')
port_dm = rc.get('达梦', 'port')

##配置greenplum数据库
user_greenplum = rc.get('greenplum', 'user')
password_greenplum = rc.get('greenplum', 'password')
database_greenplum = rc.get('greenplum', 'database')
port_greenplum = rc.get('greenplum', 'port')
host_greenplum = rc.get('greenplum', 'host')

##配置postgresql数据库
user_postgresql = rc.get('postgresql', 'user')
password_postgresql = rc.get('postgresql', 'password')
database_postgresql = rc.get('postgresql', 'database')
port_postgresql = rc.get('postgresql', 'port')
host_postgresql = rc.get('postgresql', 'host')